package com.gxa.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.gxa.common.LayR;
import com.gxa.mapper.OrderFormMapper;
import com.gxa.param.MyTableParam;
import com.gxa.pojo.OrderForm;
import com.gxa.pojo.OrderSelect;
import com.gxa.service.OrderFormService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderFormServiceImpl implements OrderFormService {
    @Autowired
    private OrderFormMapper mapper;
    @Override
    public LayR list(MyTableParam param) {
        PageHelper.startPage(param.getPage(),param.getLimit());

        List<OrderForm> allForList = mapper.findAllForList(param);

        PageInfo<OrderForm> orderSelectPageInfo = new PageInfo<>(allForList);

        return new LayR(0,"success",orderSelectPageInfo.getList(),orderSelectPageInfo.getTotal());

    }
}
